SELECT
<#assign prefixName=' '>
<#if (select__endDaTi??)>
${prefixName} T.END_DA_TI AS endDaTi
	<#assign prefixName=','>
</#if>
<#if (select__orderNum??)>
${prefixName} T.ORDER_NUM AS orderNum
	<#assign prefixName=','>
</#if>
<#if (select__code??)>
${prefixName} T.CODE AS code
	<#assign prefixName=','>
</#if>
<#if (select__url??)>
${prefixName} T.URL AS url
	<#assign prefixName=','>
</#if>
<#if (select__id??)>
${prefixName} T.ID AS id
	<#assign prefixName=','>
</#if>
<#if (select__parentId??)>
${prefixName} T.PARENT_ID AS parentId
	<#assign prefixName=','>
</#if>
<#if (select__dataOptions??)>
${prefixName} T.DATA_OPTIONS AS dataOptions
	<#assign prefixName=','>
</#if>
<#if (select__siteId??)>
${prefixName} T.SITE_ID AS siteId
	<#assign prefixName=','>
</#if>
<#if (select__stateId??)>
${prefixName} T.STATE_ID AS stateId
	<#assign prefixName=','>
</#if>
<#if (select__name??)>
${prefixName} T.NAME AS name
	<#assign prefixName=','>
</#if>
<#if (select__target??)>
${prefixName} T.TARGET AS target
	<#assign prefixName=','>
</#if>
<#if (select__beginDaTi??)>
${prefixName} T.BEGIN_DA_TI AS beginDaTi
	<#assign prefixName=','>
</#if>
<#if (select__typeId??)>
${prefixName} T.TYPE_ID AS typeId
	<#assign prefixName=','>
</#if>
<#if prefixName == ' '>
  T.END_DA_TI AS endDaTi
, T.ORDER_NUM AS orderNum
, T.CODE AS code
, T.URL AS url
, T.ID AS id
, T.PARENT_ID AS parentId
, T.DATA_OPTIONS AS dataOptions
, T.SITE_ID AS siteId
, T.STATE_ID AS stateId
, T.NAME AS name
, T.TARGET AS target
, T.BEGIN_DA_TI AS beginDaTi
, T.TYPE_ID AS typeId
</#if>
FROM FD_NAVIGATION T
<#include "whereNavigationBy1.ftl">
<#assign prefixName='ORDER BY'>
<#if (order__by__endDaTi??)>
${prefixName} T.END_DA_TI ${order__by__endDaTi__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__orderNum??)>
${prefixName} T.ORDER_NUM ${order__by__orderNum__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__code??)>
${prefixName} T.CODE ${order__by__code__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__url??)>
${prefixName} T.URL ${order__by__url__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__id??)>
${prefixName} T.ID ${order__by__id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__parentId??)>
${prefixName} T.PARENT_ID ${order__by__parentId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__dataOptions??)>
${prefixName} T.DATA_OPTIONS ${order__by__dataOptions__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__siteId??)>
${prefixName} T.SITE_ID ${order__by__siteId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__stateId??)>
${prefixName} T.STATE_ID ${order__by__stateId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__name??)>
${prefixName} T.NAME ${order__by__name__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__target??)>
${prefixName} T.TARGET ${order__by__target__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__beginDaTi??)>
${prefixName} T.BEGIN_DA_TI ${order__by__beginDaTi__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__typeId??)>
${prefixName} T.TYPE_ID ${order__by__typeId__value!}
	<#assign prefixName=','>
</#if>
